﻿<Window x:Class="DaphneForms.CheckersBoardManageForm"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ignore="http://www.ignore.com"
        xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"       
        mc:Ignorable="d ignore" Width="800" Height="400" Title="{loc:Translate Default='Checkers Board Engine Management'}"
         WindowStartupLocation="CenterScreen"        
        ResizeMode="NoResize"
        >

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        
        <!-- Loaded Engine List -->
        <Grid Grid.Column="0" Margin="5">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />                                
            </Grid.RowDefinitions>

            <DataGrid Grid.Row="0" AutoGenerateColumns="False" x:Name="uxLoadedEngines" SelectedValue="{Binding Path=SelectedLoadedEngine, Mode=TwoWay}">
                <DataGrid.Columns>
                    <DataGridTextColumn Width="1*" Header="{loc:Translate Default='Engine Name'}" />
                    <DataGridTextColumn Width="1*" Header="{loc:Translate Default='Draughts Type'}" />
                </DataGrid.Columns>                
            </DataGrid>
            
            <Button Grid.Row="1" Margin="5" HorizontalAlignment="Right" Content="{loc:Translate Default='Engine Options'}"
                    Padding="5" Command="{Binding Path=EngineOptionsCommand}"/>                                
        </Grid>
        
        <!-- Middle Button Area -->
        <StackPanel Margin="5" Orientation="Vertical" Grid.Column="1">
            <Button Margin="5" Content="&lt;&lt;" Command="{Binding Path=LoadEngineCommand}" />
            <Button Margin="5" Content="&gt;&gt;" Command="{Binding Path=UnloadEngineCommand}" />
        </StackPanel>
        
        <!-- Installed Engine List -->
        <Grid Grid.Column="2" Margin="5">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />                
            </Grid.RowDefinitions>

            <DataGrid Grid.Row="0" AutoGenerateColumns="False" x:Name="uxUnloadedEngines" SelectedValue="{Binding Path=SelectedUnloadedEngine}">
                <DataGrid.Columns>
                    <DataGridTextColumn Width="1*" Header="{loc:Translate Default='Engine Name'}" />
                    <DataGridTextColumn Width="1*" Header="{loc:Translate Default='Draughts Type'}" />
                </DataGrid.Columns>
            </DataGrid>
            
            <GroupBox Header="{loc:Translate Default='Engine Path'}" Grid.Row="1">
                <TextBlock Text="{Binding Path=EnginePath}"/>
            </GroupBox>
            
            <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Margin="5" Content="{loc:Translate Default='Install Engine'}" Padding="5" 
                         Command="{Binding Path=InstallEngineCommand}"/>
                <Button Margin="5" Content="{loc:Translate Default='Remove Engine'}" Padding="5"
                        Command="{Binding Path=RemoveEngineCommand}"/>
            </StackPanel>
        </Grid>
        
        <!-- Right Button Area -->
        <Grid Grid.Column="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            
            <Button Grid.Row="0"  Margin="10" Padding="5" Content="{loc:Translate Default='Close form'}"
                  Command="{Binding Path=CloseCommand}"   />
            
        </Grid>
    </Grid>
</Window>
